﻿using ExpressionEvaluator;
using Microsoft.CSharp;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sqlsearcher.Models
{
    public class DynamicExec
    {
        public static string ConsoleString()
        {
            var code = @"";
            return code;
        }

        public static string Run(string code)
        {
            var types = new TypeRegistry();
            types.RegisterDefaultTypes();

            var expression = new CompiledExpression(code) { TypeRegistry = types };
            var result = expression.Eval();
            return result.ToString();
        }
    }
}
